﻿using UnityEngine;
using System.Collections;
using Dict.DataModel;

namespace UI
{
    public class NPCUIRecycleBinPage : NPCUIPageTemplete
    {

        public override void SendCSMsg(object o)
        {
            var playerId = StaticData.playerData.playerId;
            if(UIUnionFightRunMap.GetNetData().netActor.players[playerId].ownRes.resourceNum <= 0)
            {
                BoxManager.CreatePopupTextBox(TableTextBlo.GetText("union_fight_recycleBin_no_res"));
                return;
            }
            else
            {
                var str = TableTextBlo.GetText("union_fight_ask_up_res");
                BoxManager.CreateMessageBoxWithCofirmAndCancelButton(str, (b) => 
                {
                    if(b)
                    {
                        var npc = (TableUnionFightNpc)o;
                        UIUnionFightRunMap.GetNetData().SendCSUFPlayerUpResource(npc.UFNId.ToString());
                    }
                });
            }
        }
    }
}

